package net.wisos.opn.common.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import net.wisos.opn.account.entity.User;
import net.wisos.opn.entity.BaseEntity;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@SuppressWarnings("serial")
@Entity
@Table(name = "comment")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Comment extends BaseEntity {
	/**
	 * 评论内容
	 */
	private String content;

	/**
	 * 评论目标
	 */
	private String objective;
	/**
	 * 评论目标id
	 */
	private Long objectiveId;

	/**
	 * 创建人
	 */
	private User createBy;
	/**
	 * 创建赶时间
	 */
	private Date dateline;

	/**
	 * 是否隐藏
	 */
	private boolean hidden;

	/**
	 * @return the content
	 */
	public String getContent() {
		return content;
	}

	/**
	 * @param content
	 *            the content to set
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * @return the objective
	 */
	public String getObjective() {
		return objective;
	}

	/**
	 * @param objective
	 *            the objective to set
	 */
	public void setObjective(String objective) {
		this.objective = objective;
	}

	/**
	 * @return the objectiveId
	 */
	public Long getObjectiveId() {
		return objectiveId;
	}

	/**
	 * @param objectiveId
	 *            the objectiveId to set
	 */
	public void setObjectiveId(Long objectiveId) {
		this.objectiveId = objectiveId;
	}

	/**
	 * @return the dateline
	 */
	public Date getDateline() {
		return dateline;
	}

	/**
	 * @param dateline
	 *            the dateline to set
	 */
	public void setDateline(Date dateline) {
		this.dateline = dateline;
	}

	/**
	 * @return the hidden
	 */
	public boolean isHidden() {
		return hidden;
	}

	/**
	 * @param hidden
	 *            the hidden to set
	 */
	public void setHidden(boolean hidden) {
		this.hidden = hidden;
	}

	/**
	 * @return the createBy
	 */
	@ManyToOne
	@JoinColumn(name = "createBy")
	@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
	public User getCreateBy() {
		return createBy;
	}

	/**
	 * @param createBy
	 *            the createBy to set
	 */
	public void setCreateBy(User createBy) {
		this.createBy = createBy;
	}
}
